/*
 * Created on 2005-11-5
 *
 */
package com.yl.cap.analyst.report.helper.operator;

import java.util.ArrayList;
import java.util.List;

public class OperatorFromXML extends Operator
{
    protected List getOperatorFromStr(String con)
    {
        List groupList = new ArrayList();
        
        int poPos = con.indexOf("<popedom>");
        int poePos = con.indexOf("</popedom>");
        int grPos = con.indexOf("<role>", poPos);
        int grePos = 0;

        while (grPos!=-1 && grPos<poePos)
        {
            grePos = con.indexOf("</role>", grPos);
            groupList.add(con.substring(grPos + 6, grePos));
            grPos = con.indexOf("<role>", grePos);
        }
        return groupList;
    }
    
//    public static void main(String[] arg) throws Exception
//    {
//        Operator o = new OperatorFromXML();
//        List r = o.getOperator("E:\\project\\workspace\\Reporter\\WebContent\\conf\\task\\051011.xml");
//        for (int i = 0; i < r.size(); i++)
//        {
//            System.out.println(r.get(i));
//        }
//    }
}
